package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MrModalityMapper;
import com.ruoyi.system.domain.MrModality;
import com.ruoyi.system.service.IMrModalityService;

/**
 * 设备类型Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-05-08
 */
@Service
public class MrModalityServiceImpl implements IMrModalityService 
{
    @Autowired
    private MrModalityMapper mrModalityMapper;

    /**
     * 查询设备类型
     * 
     * @param modalityId 设备类型主键
     * @return 设备类型
     */
    @Override
    public MrModality selectMrModalityByModalityId(Long modalityId)
    {
        return mrModalityMapper.selectMrModalityByModalityId(modalityId);
    }

    /**
     * 查询设备类型列表
     * 
     * @param mrModality 设备类型
     * @return 设备类型
     */
    @Override
    public List<MrModality> selectMrModalityList(MrModality mrModality)
    {
        return mrModalityMapper.selectMrModalityList(mrModality);
    }

    /**
     * 新增设备类型
     * 
     * @param mrModality 设备类型
     * @return 结果
     */
    @Override
    public int insertMrModality(MrModality mrModality)
    {
        mrModality.setCreateTime(DateUtils.getNowDate());
        return mrModalityMapper.insertMrModality(mrModality);
    }

    /**
     * 修改设备类型
     * 
     * @param mrModality 设备类型
     * @return 结果
     */
    @Override
    public int updateMrModality(MrModality mrModality)
    {
        mrModality.setUpdateTime(DateUtils.getNowDate());
        return mrModalityMapper.updateMrModality(mrModality);
    }

    /**
     * 批量删除设备类型
     * 
     * @param modalityIds 需要删除的设备类型主键
     * @return 结果
     */
    @Override
    public int deleteMrModalityByModalityIds(Long[] modalityIds)
    {
        return mrModalityMapper.deleteMrModalityByModalityIds(modalityIds);
    }

    /**
     * 删除设备类型信息
     * 
     * @param modalityId 设备类型主键
     * @return 结果
     */
    @Override
    public int deleteMrModalityByModalityId(Long modalityId)
    {
        return mrModalityMapper.deleteMrModalityByModalityId(modalityId);
    }
}
